package com.codeyourlife.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.codeyourlife.dao.CourseDao;
import com.codeyourlife.entity.Course;
import com.codeyourlife.entity.Lesson;
import com.codeyourlife.service.CourseService;

@Service("courseService")
public class CourseServiceImpl implements CourseService {

	@Autowired
	private CourseDao courseDao;

	public List<Object> findCourseByEle(String director, String type, String degree, String orderstyle,
			int pageNumber) {
		return courseDao.findCourseByEle(director, type, degree, orderstyle, pageNumber);
	}

	public List<Lesson> findCourseInfo(int id) {
		return courseDao.findCourseLesson(id);
	}

	public Course findCourseById(int id) {
		return courseDao.findCourseById(id);
	}

	public void addLesson(Lesson lesson) {
		courseDao.addLesson(lesson); 
		
	}

	public List<Object> courseInfo(int userId, int courseId) {
		// TODO Auto-generated method stub
		return courseDao.courseInfo(userId,courseId);
	}

}
